package core;
import org.json.JSONObject;


public class Resource extends Point {
	private ResourceType myType;
	private int IncomeValue;
	public Resource(FlowerGrid grid,ResourceType rt, int IncomeVal) {
		super(grid);
		myType = rt;
		IncomeValue = IncomeVal;
	}
	public String toString() {
		return "[Resource:"+getLocation().toString()+"]";
	}
	@Override
	public JSONObject typeJSON() {
		try {
			JSONObject me = new JSONObject();
			me.put("type", "resource");
			me.put("resource", myType.toString());
			me.put("incomeval", IncomeValue);
			return me;
		}
		catch(Exception e) {
			e.printStackTrace();
		}
		return null;
	}
	public int getIncomeValue() {
		return IncomeValue;
	}
}
